﻿<Window x:Name="CreateWorkItemWindow" x:Class="TeamReview.UI.CreateWorkItemForm"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:TeamReview"
        Title="New inhouse Code review request window" Height="569" Width="430"  >
    <Window.Resources>
        <local:CreateWorkItemViewModel x:Key="CreateWorkItemVM" />
    </Window.Resources>
    <Grid DataContext="{StaticResource CreateWorkItemVM}">
        <Grid Margin="0,0,0,0">
            <Label Content="Query From:" Grid.Column="0" Grid.Row="0"/>
            <ComboBox Name="ComboQueryFrom" Margin="76,0,0,267" Grid.Row="0" SelectedItem="{Binding SelectedRecord.QueryFrom}" ItemsSource="{Binding QueryFromList}" DisplayMemberPath="{Binding /Name}" >
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <WrapPanel  Orientation="Horizontal">
                            <TextBlock Text="{Binding Path=Name}" Padding="10,0,0,0"/>
                        </WrapPanel>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
            <Label Content="Link To:" Margin="0,29,346,484" Grid.Column="0"/>
            <ComboBox Name="ComboLinkTo" Margin="76,29,0,233" SelectedItem="{Binding SelectedRecord.LinkTo}" ItemsSource="{Binding LinkToList}" DisplayMemberPath="{Binding /Name}">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <WrapPanel  Orientation="Horizontal">
                            <TextBlock Text="{Binding Path=Name}" Padding="10,0,0,0"/>
                        </WrapPanel>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
            <Label Content="Assign To:" Margin="0,53,346,455" Grid.Column="0"/>
            <ComboBox Name="ComboAssignTo" Margin="76,58,0,208" SelectedItem="{Binding SelectedRecord.AssignTo, Source={StaticResource CreateWorkItemVM}}" ItemsSource="{Binding AssignedToList}" />
            <Label Content="Title:" Margin="0,83,346,426" Grid.Column="0"/>
            <TextBox Name="TextboxTitle" Margin="76,87,0,180" Text="{Binding SelectedRecord.Title, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsReadOnly="True" />
            <Label Content="Priority:" Margin="0,110,351,392" Grid.Column="0"/>
            <ComboBox Name="ComboPriority" Margin="76,116,0,372" SelectedItem="{Binding SelectedRecord.Priority, Source={StaticResource CreateWorkItemVM}}" ItemsSource="{Binding PriorityAllowedValuesList}" />
            <Label Content="Type:" Margin="0,140,346,372" Grid.Column="0"/>
            <ComboBox Name="ComboType" Margin="76,150,0,112" SelectedItem="{Binding SelectedRecord.CodeType, Source={StaticResource CreateWorkItemVM}}" ItemsSource="{Binding CodeItemType}" SelectedIndex="0" IsReadOnly="True" />
            <Label Content="Changeset:" Margin="0,170,351,341" Grid.Column="0"/>
        </Grid>
        <Grid Margin="0,202,0,0" Grid.Column="0" Grid.Row="6" >
            <Label Content="Description:" Margin="0,0,344,317" Grid.Column="0" Grid.Row="0">
            </Label>
            <TextBox Name="TextboxDescription" Margin="0,23,0,243" VerticalScrollBarVisibility="Auto" BorderThickness="2,2" MaxLines="5" MinLines="1"  Text="{Binding SelectedRecord.Description, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
            </TextBox>
            <Label Content="Suggested resolution:" HorizontalAlignment="Left" Margin="0,97,0,0" VerticalAlignment="Top"/>
            <TextBox x:Name="TextboxSuggestedResn" Margin="0,0,0,116" VerticalScrollBarVisibility="Auto" BorderThickness="1,2" MaxLines="100" Text="{Binding SelectedRecord.SuggestedSolution, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Height="104" VerticalAlignment="Bottom"/>
            <Label Content="Code Snippet:" HorizontalAlignment="Left" Margin="0,217,0,0" VerticalAlignment="Top"/>
            <TextBox x:Name="CodeSnippetTextBox" VerticalScrollBarVisibility="Auto" BorderThickness="1,2" MaxLines="2000" Text="{Binding SelectedRecord.CodeSnippet, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Height="104" VerticalAlignment="Bottom" IsReadOnly="True" IsReadOnlyCaretVisible="True"/>
        </Grid>
    </Grid>
</Window>
